
<%@page import="java.io.File"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="org.apache.commons.io.FileUtils"%><%@ taglib prefix="s" uri="/struts-tags"%>

<s:set var="img" value="uploadedFiles[0].name" />

<%
	File file = new File(System.getProperty("java.io.tmpdir") + "\\" + pageContext.getAttribute("img").toString());
	File destFile = new File(pageContext.getServletContext().getRealPath("images") + "\\" + pageContext.getAttribute("img").toString());
	FileUtils.copyFile(file, destFile);
    response.setContentType("image/jpeg");
    byte[] b = new byte[(int) destFile.length()];
	FileInputStream fs = new FileInputStream(destFile);
	fs.read(b);
    response.getOutputStream().write(b);
    response.getOutputStream().flush();
    response.getOutputStream().close();
%>